package com.haierp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.haierp.mapper.InventoryRecordMapper;
import com.haierp.model.InventoryRecord;
import com.haierp.model.InventoryRecord.InventoryType;
import com.haierp.service.IInventoryRecordService;

@Service("inventoryRecordService")
public class InventoryRecordServiceImpl extends SuperServiceImpl<InventoryRecordMapper, InventoryRecord>
		implements IInventoryRecordService {

	@Autowired
	private InventoryRecordMapper inventoryRecordMapper;

	@Override
	public int sumBookedBySkuId(Long orderId, Long erpOrderId) {
		Integer booked = inventoryRecordMapper.sumBookedBySkuId(orderId, erpOrderId);
		return booked == null ? 0 : booked;
	}

	@Override
	public List<InventoryRecord> queryByErpOrderId(Long erpOrderId) {
		return inventoryRecordMapper.queryByErpOrderId(erpOrderId);
	}

	@Override
	public List<InventoryRecord> sumBookedByInventoryType(Long orderId, Long erpOrderId) {
		return inventoryRecordMapper.sumBookedByInventoryType(orderId, erpOrderId);
	}

	@Override
	public List<InventoryRecord> sumInventoryCheckRecord(Long inventoryAreaId,InventoryType inventoryType,List<Integer> status) {
		return inventoryRecordMapper.sumInventoryCheckRecord(inventoryAreaId,inventoryType,status);
	}
	
	
}
